// @ts-ignore
import {createConnection} from "typeorm";
import Log4js from '../log/Log4jsConfig'

const logger = Log4js.getLogger('TypeORM')

async function createConn() {
    let connection: any = null
    // @ts-ignore
    await createConnection().then(connec => {
        connection = connec
        logger.info('创建数据库连接')
        // @ts-ignore
    }).catch(error => {
        console.log(error)
    })
    return connection
}

export const conn = createConn()
